package com.sto.stoapp.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.sto.stoapp.http.BaseMessage;

/**
 * 路由记录实体类
 * @author mgf
 *
 */
public class RouteEntity extends BaseEntity implements Parcelable {

    private String routeCode; // 路由号
    private String nextStation; // 下一目的地
    private String centerDes; // 二级中转目的地
    private String shift; // 班次
    private String tranType; // 运输方式
    
    public RouteEntity() {
        
    }
    
    public RouteEntity(String responseDetail) {
        String[] data = responseDetail.split(BaseMessage.SPILTE
                + BaseMessage.SEPARATOR);
        if (data.length > 0) {
            routeCode = data[0].trim();
        }
        if (data.length > 1) {
            nextStation = data[1].trim();
        }
        if (data.length > 2) {
            centerDes = data[2].trim();
        }

    }
    
    public String getRouteCode() {
        return routeCode;
    }
    
    public void setRouteCode(String routeCode) {
        this.routeCode = routeCode;
    }
    
    public String getNextStation() {
        return nextStation;
    }
    
    public void setNextStation(String nextStation) {
        this.nextStation = nextStation;
    }
    
    public String getCenterDes() {
        return centerDes;
    }
    
    public void setCenterDes(String centerDestination) {
        this.centerDes = centerDestination;
    }
    
    public String getShift() {
        return shift;
    }
    
    public void setShift(String shift) {
        this.shift = shift;
    }
    
    public String getTranType() {
        return tranType;
    }
    
    public void setTranType(String tranType) {
        this.tranType = tranType;
    }

    @Override
    public String toString() {
        return "RouteEntity [routeCode=" + routeCode + ", nextStation="
                + nextStation + ", centerDes=" + centerDes + "]";
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.routeCode);
        dest.writeString(this.nextStation);
        dest.writeString(this.centerDes);
        dest.writeString(this.shift);
        dest.writeString(this.tranType);
    }

    protected RouteEntity(Parcel in) {
        this.routeCode = in.readString();
        this.nextStation = in.readString();
        this.centerDes = in.readString();
        this.shift = in.readString();
        this.tranType = in.readString();
    }

    public static final Parcelable.Creator<RouteEntity> CREATOR = new Parcelable.Creator<RouteEntity>() {
        @Override
        public RouteEntity createFromParcel(Parcel source) {
            return new RouteEntity(source);
        }

        @Override
        public RouteEntity[] newArray(int size) {
            return new RouteEntity[size];
        }
    };
}
